package cn.iocoder.yudao.module.dlbz.dal.mysql.company;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.dlbz.dal.dataobject.company.CompanyDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.dlbz.controller.admin.company.vo.*;

/**
 * 合作企业管理 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface CompanyMapper extends BaseMapperX<CompanyDO> {

    default PageResult<CompanyDO> selectPage(CompanyPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CompanyDO>()
                .likeIfPresent(CompanyDO::getName, reqVO.getName())
                .eqIfPresent(CompanyDO::getAddr, reqVO.getAddr())
                .likeIfPresent(CompanyDO::getContactName, reqVO.getContactName())
                .eqIfPresent(CompanyDO::getContactPhone, reqVO.getContactPhone())
                .eqIfPresent(CompanyDO::getImgUrl, reqVO.getImgUrl())
                .eqIfPresent(CompanyDO::getIntro, reqVO.getIntro())
                .betweenIfPresent(CompanyDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(CompanyDO::getId));
    }

}